package com.example.weather;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;



public class ViewPagerAdapter extends FragmentPagerAdapter {
    private List<String> tabs;
    private List<Fragment> listfragment;
    private Context context;


    public ViewPagerAdapter(FragmentManager fm, List<Fragment> listfragment, Context context) {
        super(fm);
        this.listfragment = listfragment;
        this.context = context;
    }



//    protected void bindView(TempratureView itemView, WeatherData.DataBean.ForecastBean itemBean) {
//        itemView.setData(itemBean);
//    }

    @Override
    public Fragment getItem(int position) {
        return listfragment.get(position);
    }

    @Override
    public int getCount() {
        return listfragment.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0:
                return "广州";
            case 1:
                return "北京";
            case 2:
                return "上海";
            case 3:
                return "查询";
        }
        return "广州";
    }
}
